<template>
  <div class="page-container">
    <!-- 轮播图区域 -->
    <div class="carousel-container w-full relative overflow-hidden group" @mouseenter="isHovered = true" @mouseleave="isHovered = false">
      <div class="carousel-wrapper flex transition-transform duration-500 ease-in-out" :style="{ transform: `translateX(-${currentIndex * 100}%)` }">
        <div v-for="(item, index) in carouselList" :key="index" class="carousel-slide w-full flex-shrink-0 relative">
          <NuxtImg
            :src="item.imageUrl || item.image || '/placeholder-carousel.jpg'"
            :alt="item.title || `轮播图 ${index + 1}`"
            class="w-full h-64 md:h-80 lg:h-96 xl:h-[500px] object-cover"
            loading="lazy"
          />
        </div>
      </div>

      <!-- 导航指示器 - 默认显示 -->
      <div v-if="carouselList.length > 1" class="absolute bottom-4 left-1/2 transform -translate-x-1/2 flex space-x-2">
        <div
          v-for="(item, index) in carouselList"
          :key="index"
          @click="goToSlide(index)"
          class="dot-item rounded-full transition-all duration-300"
          :class="currentIndex === index ? 'dot-active' : 'hover:bg-gray-200'"
        ></div>
      </div>

      <!-- 左右箭头 - 悬停时显示 -->
      <div
        v-if="carouselList.length > 1"
        @click="prevSlide"
        class="absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-800 p-2 rounded-full transition-all duration-300"
        :class="isHovered ? 'opacity-100' : 'opacity-0'"
      >
        <Icon name="i-heroicons-chevron-left" class="w-6 h-6" />
      </div>
      <div
        v-if="carouselList.length > 1"
        @click="nextSlide"
        class="absolute right-4 top-1/2 transform -translate-y-1/2 text-gray-800 p-2 rounded-full transition-all duration-300"
        :class="isHovered ? 'opacity-100' : 'opacity-0'"
      >
        <Icon name="i-heroicons-chevron-right" class="w-6 h-6" />
      </div>
    </div>
    <!-- 产品展示的区域 -->
    <div class="area_wrap max-width" v-if="prodInfo">
      <div class="area_title">
        <div class="title">{{ prodInfo.menu?.name }}</div>
        <div class="desc">
          {{ prodInfo.menu?.description }}
        </div>
      </div>
      <div class="area_content prod_content">
        <div class="prod_left">
          <div class="contact-form-container">
            <h3 class="form-title">联系我们</h3>
            <form @submit.prevent="submitContactForm" class="contact-form">
              <div class="form-group">
                <input v-model="contactForm.customerName" type="text" placeholder="您的姓名" class="form-input" required />
              </div>
              <div class="form-group">
                <input v-model="contactForm.telephone" type="tel" placeholder="联系电话" class="form-input" required />
              </div>
              <div class="form-group">
                <input v-model="contactForm.productionName" type="text" placeholder="产品名称" class="form-input" required />
              </div>
              <button type="submit" class="submit-btn">立即咨询</button>
            </form>
          </div>
        </div>
        <div class="prod_list">
          <UCarousel v-slot="{ item }" loop wheel-gestures :items="prodImgList" :ui="{ item: 'basis-1/4' }" class="prod_carousel">
            <div class="prod_list_item">
              <NuxtImg :src="item.url" class="prod_list_item_img"></NuxtImg>
              <div class="item_content">
                <div class="prod_list_item_title">{{ item.title }}</div>
                <div class="prod_list_item_desc">{{ item.description }}</div>
                <div class="prod_list_item_more">
                  <NuxtLink :to="item.link">查看更多-></NuxtLink>
                </div>
              </div>
            </div>
          </UCarousel>
        </div>
      </div>
    </div>
    <!-- 关于我们的区域 -->
    <div class="area_wrap" v-if="aboutInfo">
      <!-- 关于我们内容区域 -->
      <div class="about-content-wrapper">
        <div class="about-hero-section">
          <div class="about-hero-content">
            <div class="about-icon-container" v-if="aboutInfo.menu?.icon">
              <NuxtImg :src="aboutInfo.menu.icon" :alt="aboutInfo.menu?.name" class="about-main-icon" />
            </div>
            <div class="about-hero-text">
              <h2 class="about-hero-title">{{ aboutInfo.menu?.name }}</h2>
              <p class="about-hero-description">{{ aboutInfo.menu?.description }}</p>
            </div>
          </div>
        </div>

        <div class="about-features-section" v-if="aboutInfo.listDetails && aboutInfo.listDetails.length > 0">
          <div class="about-features-grid">
            <div v-for="(detail, index) in aboutInfo.listDetails" :key="detail._id" class="about-feature-card" :class="`feature-card-${index + 1}`">
              <div class="feature-card-header">
                <div class="feature-card-icon">
                  <Icon name="i-heroicons-star" class="feature-icon" />
                </div>
                <h3 class="feature-card-title">{{ detail.title }}</h3>
              </div>
              <div class="feature-card-body">
                <p class="feature-card-subtitle" v-if="detail.subtitle">{{ detail.subtitle }}</p>
                <div class="feature-card-content" v-html="detail.content"></div>
                <div class="feature-parameters" v-if="detail.parameters && detail.parameters.length > 0">
                  <div v-for="param in detail.parameters" :key="param.name" class="parameter-tag">
                    {{ param.value }}
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>

        <div class="about-cta-section">
          <div class="about-cta-content">
            <h3 class="cta-title">了解更多关于我们</h3>
            <p class="cta-description">探索我们的技术实力与创新能力</p>
            <div class="cta-buttons">
              <button class="cta-btn primary-btn" @click.stop="$router.push(aboutInfo.menu?.link)">
                <NuxtLink :to="aboutInfo.menu?.link">联系我们</NuxtLink>
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 新闻列表 -->
    <div class="area_wrap" v-if="newsInfo">
      <div class="area_title">
        <div class="title">{{ newsInfo.menu?.name }}</div>
        <div class="desc">
          {{ newsInfo.menu?.description }}
        </div>
      </div>
      
      <!-- 资讯列表内容区域 -->
      <div class="news-content-wrapper">
        <div class="news-hero-section">
          <div class="news-hero-content">
            <div class="news-hero-text">
              <h2 class="news-hero-title">{{ newsInfo.menu?.name }}</h2>
              <p class="news-hero-description">{{ newsInfo.menu?.description }}</p>
            </div>
            <div class="news-stats">
              <div class="stat-item">
                <div class="stat-number">{{ newsInfo.total || 0 }}</div>
                <div class="stat-label">资讯总数</div>
              </div>
              <div class="stat-item">
                <div class="stat-number">{{ newsInfo.listDetails?.length || 0 }}</div>
                <div class="stat-label">最新资讯</div>
              </div>
            </div>
          </div>
        </div>
        
        <div class="news-list-section" v-if="newsInfo.listDetails && newsInfo.listDetails.length > 0">
          <div class="news-list-grid">
            <article 
              v-for="(news, index) in newsInfo.listDetails.slice(0, 6)" 
              :key="news._id"
              class="news-item-card"
              :class="`news-card-${index + 1}`"
            >
              <div class="news-card-image" v-if="news.mainImages && news.mainImages[0]">
                <NuxtImg 
                  :src="news.mainImages[0]" 
                  :alt="news.title"
                  class="news-image"
                />
                <div class="news-overlay">
                  <div class="news-category" v-if="news.categoryName">
                    {{ news.categoryName }}
                  </div>
                  <div class="news-date" v-if="news.createdAt">
                    {{ formatDate(news.createdAt) }}
                  </div>
                </div>
              </div>
              
              <div class="news-card-content">
                <div class="news-card-header">
                  <h3 class="news-card-title">{{ news.title }}</h3>
                  <div class="news-meta">
                    <span class="news-author" v-if="news.author">{{ news.author }}</span>
                    <span class="news-views" v-if="news.viewCount">
                      <Icon name="i-heroicons-eye" class="view-icon" />
                      {{ news.viewCount }}
                    </span>
                  </div>
                </div>
                
                <div class="news-card-body">
                  <div class="news-content-preview" v-html="truncateContent(news.content, 150)"></div>
                  
                  <div class="news-tags" v-if="news.tags && news.tags.length > 0">
                    <span 
                      v-for="tag in news.tags.slice(0, 3)" 
                      :key="tag"
                      class="news-tag"
                    >
                      {{ tag }}
                    </span>
                  </div>
                </div>
                
                <div class="news-card-footer">
                  <button class="news-read-more">
                    阅读全文
                    <Icon name="i-heroicons-arrow-right" class="arrow-icon" />
                  </button>
                  <div class="news-actions">
                    <button class="action-btn like-btn" v-if="news.isRecommend">
                      <Icon name="i-heroicons-heart" class="action-icon" />
                    </button>
                    <button class="action-btn share-btn">
                      <Icon name="i-heroicons-share" class="action-icon" />
                    </button>
                  </div>
                </div>
              </div>
            </article>
          </div>
          
          <div class="news-load-more" v-if="newsInfo.total > 6">
            <button class="load-more-btn">
              <Icon name="i-heroicons-plus" class="plus-icon" />
              加载更多资讯
            </button>
          </div>
        </div>
        
        <div class="news-empty-state" v-else>
          <div class="empty-content">
            <Icon name="i-heroicons-document-text" class="empty-icon" />
            <h3 class="empty-title">暂无资讯</h3>
            <p class="empty-description">敬请期待更多精彩内容</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
const appConfig = useAppConfig();
const { siteInfo } = appConfig.systemConfig;
import { getCarouselList, getIndexData, doConsult } from "@/api/projects";
import type { FormError, FormSubmitEvent } from "@nuxt/ui";
const carouselList = ref<any[]>([]);
const currentIndex = ref(0);
const autoPlayTimer = ref<NodeJS.Timeout | null>(null);
const isHovered = ref(false);
const prodInfo = ref<any>({}); // 产品数据
const newsInfo = ref<any>({}); // 新闻数据
const aboutInfo = ref<any>({}); // 关于我们数据
const contactInfo = ref<any>({}); // 联系我们数据
const prodImgList = ref<string[]>([]); // 产品图片列表
const toast = useToast();
const contactForm = reactive({
  telephone: "",
  productionName: "",
  customerName: ""
});

/**
 * 提交联系表单 - 处理用户提交的联系信息
 */
const submitContactForm = () => {
  // 验证表单数据
  if (!contactForm.customerName.trim()) {
    alert("请输入您的姓名");
    return;
  }
  if (!contactForm.telephone.trim()) {
    alert("请输入联系电话");
    return;
  }
  if (!contactForm.productionName.trim()) {
    alert("请输入产品名称");
    return;
  }

  doConsult(contactForm).then((res) => {
    toast.add({ title: "提示", description: "提交成功！我们会尽快与您联系。" });
    contactForm.customerName = "";
    contactForm.telephone = "";
    contactForm.productionName = "";
  });
};

/**
 * 初始化页面数据 - 获取轮播图列表
 */
const initPage = async () => {
  getCarouselList().then((res) => {
    console.log("getCarouselList", res);
    carouselList.value = res.data || [];
    // 如果有轮播图数据，启动自动播放
    if (carouselList.value.length > 1) {
      startAutoPlay();
    }
  });
  getIndexData().then((res) => {
    console.log("首页数据", res);
    if (Array.isArray(res) && res.length > 0) {
      res.forEach((item) => {
        if (item.menu.name.includes("产品")) {
          prodInfo.value = item;
          if (item.listDetails?.length) {
            prodImgList.value = item.listDetails.map((listItem: any) => {
              return {
                url: listItem.mainImages[0],
                title: listItem.title,
                description: listItem.description,
                link: listItem.link
              };
            });
          }
          console.log(prodImgList.value, "prodImgList");
        } else if (item.menu.name.includes("新闻")) {
          newsInfo.value = item;
        } else if (item.menu.name.includes("关于")) {
          aboutInfo.value = item;
        } else if (item.menu.name.includes("联系")) {
          contactInfo.value = item;
        }
      });
    }
    console.log(newsInfo.value, "newsList");
  });
};

/**
 * 跳转到指定幻灯片 - 用户点击指示器时调用
 * @param index 来源：用户点击的指示器索引
 */
const goToSlide = (index: number) => {
  currentIndex.value = index;
  resetAutoPlay();
};

/**
 * 切换到上一张幻灯片 - 用户点击左箭头时调用
 */
const prevSlide = () => {
  currentIndex.value = currentIndex.value === 0 ? carouselList.value.length - 1 : currentIndex.value - 1;
  resetAutoPlay();
};

/**
 * 切换到下一张幻灯片 - 用户点击右箭头或自动播放时调用
 */
const nextSlide = () => {
  currentIndex.value = (currentIndex.value + 1) % carouselList.value.length;
};

/**
 * 启动自动播放 - 每5秒切换一次幻灯片
 */
const startAutoPlay = () => {
  autoPlayTimer.value = setInterval(() => {
    nextSlide();
  }, 5000);
};

/**
 * 停止自动播放 - 清除定时器
 */
const stopAutoPlay = () => {
  if (autoPlayTimer.value) {
    clearInterval(autoPlayTimer.value);
    autoPlayTimer.value = null;
  }
};

/**
 * 重置自动播放 - 先停止再启动，用于用户交互后重新开始计时
 */
const resetAutoPlay = () => {
  stopAutoPlay();
  if (carouselList.value.length > 1) {
    startAutoPlay();
  }
};

/**
 * 格式化日期 - 将ISO日期字符串转换为可读格式
 * @param dateString 来源：数据库中的ISO日期字符串
 */
const formatDate = (dateString: string) => {
  const date = new Date(dateString);
  return date.toLocaleDateString('zh-CN', {
    year: 'numeric',
    month: 'long',
    day: 'numeric'
  });
};

/**
 * 截取富文本内容 - 移除HTML标签并限制字符长度
 * @param content 来源：富文本内容字符串
 * @param maxLength 来源：最大字符长度限制
 */
const truncateContent = (content: string, maxLength: number = 150) => {
  if (!content) return '';
  
  // 移除HTML标签
  const textContent = content.replace(/<[^>]*>/g, '');
  
  // 截取指定长度
  if (textContent.length <= maxLength) {
    return textContent;
  }
  
  return textContent.substring(0, maxLength) + '...';
};

// 组件挂载时初始化
initPage();

// 组件卸载时清理定时器
onUnmounted(() => {
  stopAutoPlay();
});
</script>

<style scoped lang="scss">
.carousel-container {
  .carousel-slide {
    min-width: 100%;
  }

  .dot-item {
    width: 10px;
    height: 10px;
    background-color: rgba(0, 0, 0, 0.2);
  }
  .dot-active {
    background-color: $custom-primary;
  }
}

.area_wrap {
  margin-top: 20px;
  .area_title {
    text-align: center;
    margin-bottom: 20px;
    .title {
      font-size: 22px;
      font-weight: bold;
    }
    .desc {
      font-size: 12px;
      color: #999999;
      margin-top: 8px;
    }
  }
  .area_content {
  }

  .prod_content {
    display: flex;
    padding-bottom: 20px;
    .prod_left {
      width: 200px;
      height: 280px;
      background-color: $custom-primary;
      border-radius: 8px;
      position: relative;

      .contact-form-container {
        padding: 20px 16px;
        height: 100%;
        display: flex;
        flex-direction: column;

        .form-title {
          color: $custom-white;
          font-size: 18px;
          font-weight: bold;
          margin-bottom: 20px;
          text-align: center;
        }

        .contact-form {
          flex: 1;
          display: flex;
          flex-direction: column;
          justify-content: space-between;

          .form-group {
            margin-bottom: 16px;

            .form-input {
              width: 100%;
              background: transparent;
              border: none;
              border-bottom: 1px solid rgba(255, 255, 255, 0.5);
              padding: 8px 0;
              color: $custom-white;
              font-size: 14px;
              outline: none;
              transition: border-bottom-color 0.3s ease;

              &::placeholder {
                color: rgba(255, 255, 255, 0.7);
              }

              &:focus {
                border-bottom-color: $custom-white;
              }
            }
          }

          .submit-btn {
            background-color: $custom-white;
            color: $custom-primary;
            border: none;
            border-radius: 6px;
            padding: 10px 20px;
            font-size: 14px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: auto;

            &:hover {
              background-color: rgba(255, 255, 255, 0.9);
              transform: translateY(-1px);
            }

            &:active {
              transform: translateY(0);
            }
          }
        }
      }
    }
    .prod_list {
      flex: 1;
      margin-left: 20px;
      .prod_carousel {
        height: 100%;
      }
      .prod_list_item {
        border-radius: 6px;
        width: 200px;
        height: 280px;
        overflow-y: hidden;
        margin: 0 auto;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: box-shadow 0.3s ease;

        &:hover {
          box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        }
        .item_content {
          padding: 12px 8px;
          display: flex;
          flex-direction: column;
          height: 150px;
          justify-content: space-between;
          background-color: #fff;
        }
        .prod_list_item_img {
          width: 200px;
          height: 130px;
          object-fit: cover;
          object-position: center;
          background-color: #e3e6eb;
        }
        .prod_list_item_title {
          font-size: 15px;
          font-weight: bold;
        }
        .prod_list_item_desc {
          font-size: 14px;
          color: #999999;
          display: -webkit-box;
          -webkit-line-clamp: 3;
          -webkit-box-orient: vertical;
          overflow: hidden;
          text-overflow: ellipsis;
          line-height: 1.4;
        }
        .prod_list_item_more {
          font-size: 14px;
          color: $custom-primary;
        }
        .prod_list_item_more:hover {
          cursor: pointer;
        }
      }
    }
  }
}

// 关于我们模块样式
.about-content-wrapper {
  width: 100%;
  background: linear-gradient(135deg, $custom-bg-secondary 0%, $custom-white 100%);

  .about-hero-section {
    width: 100%;
    background: linear-gradient(135deg, $custom-primary 0%, darken($custom-primary, 10%) 100%);
    padding: 60px 20px;
    position: relative;
    overflow: hidden;

    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
      opacity: 0.3;
    }

    .about-hero-content {
      max-width: $custom-maxwidth;
      margin: 0 auto;
      display: flex;
      align-items: center;
      gap: 40px;
      position: relative;
      z-index: 1;

      @media (max-width: $custom-breakpoint-md) {
        flex-direction: column;
        text-align: center;
        gap: 30px;
      }

      .about-icon-container {
        flex-shrink: 0;
        width: 120px;
        height: 120px;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(10px);
        border: 2px solid rgba(255, 255, 255, 0.2);

        @media (max-width: $custom-breakpoint-md) {
          width: 100px;
          height: 100px;
        }

        .about-main-icon {
          width: 100%;
          height: 100%;
          object-fit: cover;
          border-radius: 50%;

          @media (max-width: $custom-breakpoint-md) {
            width: 100%;
            height: 100%;
          }
        }
      }

      .about-hero-text {
        flex: 1;

        .about-hero-title {
          font-size: $custom-font-3xl;
          font-weight: $custom-font-bold;
          color: $custom-white;
          margin-bottom: 20px;
          line-height: $custom-line-tight;

          @media (max-width: $custom-breakpoint-lg) {
            font-size: $custom-font-2xl;
          }

          @media (max-width: $custom-breakpoint-md) {
            font-size: $custom-font-3xl;
            margin-bottom: 16px;
          }
        }

        .about-hero-description {
          font-size: $custom-font-base;
          color: rgba(255, 255, 255, 0.9);
          line-height: $custom-line-relaxed;
          max-width: 600px;

          @media (max-width: $custom-breakpoint-lg) {
            font-size: $custom-font-lg;
          }

          @media (max-width: $custom-breakpoint-md) {
            font-size: $custom-font-base;
            margin: 0 auto;
          }
        }
      }
    }
  }

  .about-features-section {
    padding: 80px 20px;
    max-width: $custom-maxwidth;
    margin: 0 auto;

    @media (max-width: $custom-breakpoint-md) {
      padding: 60px 20px;
    }

    .about-features-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
      gap: 40px;

      @media (max-width: $custom-breakpoint-md) {
        grid-template-columns: 1fr;
        gap: 30px;
      }

      @media (max-width: $custom-breakpoint-sm) {
        grid-template-columns: 1fr;
        gap: 24px;
      }

      .about-feature-card {
        background: $custom-white;
        border-radius: $custom-radius-2xl;
        padding: 40px 32px;
        box-shadow: $custom-shadow-lg;
        transition: all $custom-transition-normal;
        border: 1px solid $custom-gray-200;
        position: relative;
        overflow: hidden;

        &::before {
          content: "";
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 4px;
          background: linear-gradient(90deg, $custom-primary 0%, $custom-secondary 100%);
        }

        &:hover {
          transform: translateY(-8px);
          box-shadow: $custom-shadow-xl;
          border-color: $custom-primary;
        }

        @media (max-width: $custom-breakpoint-md) {
          padding: 32px 24px;
        }

        .feature-card-header {
          display: flex;
          align-items: center;
          gap: 20px;
          margin-bottom: 24px;

          .feature-card-icon {
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, $custom-primary 0%, darken($custom-primary, 10%) 100%);
            border-radius: $custom-radius-xl;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;

            .feature-icon {
              font-size: 28px;
              color: $custom-white;
            }
          }

          .feature-card-title {
            font-size: $custom-font-2xl;
            font-weight: $custom-font-bold;
            color: $custom-text-primary;
            margin: 0;
            line-height: $custom-line-tight;

            @media (max-width: $custom-breakpoint-md) {
              font-size: $custom-font-xl;
            }
          }
        }

        .feature-card-body {
          .feature-card-subtitle {
            font-size: $custom-font-lg;
            color: $custom-text-secondary;
            margin-bottom: 16px;
            font-weight: $custom-font-medium;

            @media (max-width: $custom-breakpoint-md) {
              font-size: $custom-font-base;
            }
          }

          .feature-card-content {
            font-size: $custom-font-base;
            color: $custom-text-primary;
            line-height: $custom-line-relaxed;
            margin-bottom: 24px;

            ul {
              margin: 0;
              padding-left: 20px;

              li {
                margin-bottom: 8px;
                position: relative;

                &::marker {
                  color: $custom-primary;
                }
              }
            }
          }

          .feature-parameters {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;

            .parameter-tag {
              background: linear-gradient(135deg, $custom-primary 0%, darken($custom-primary, 5%) 100%);
              color: $custom-white;
              padding: 8px 16px;
              border-radius: $custom-radius-full;
              font-size: $custom-font-sm;
              font-weight: $custom-font-medium;
              transition: all $custom-transition-fast;

              &:hover {
                transform: translateY(-2px);
                box-shadow: 0 4px 12px rgba($custom-primary, 0.3);
              }
            }
          }
        }
      }
    }
  }

  .about-cta-section {
    background: linear-gradient(135deg, $custom-secondary 0%, darken($custom-secondary, 5%) 100%);
    padding: 80px 20px;
    position: relative;
    overflow: hidden;

    &::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
      opacity: 0.5;
    }

    @media (max-width: $custom-breakpoint-md) {
      padding: 60px 20px;
    }

    .about-cta-content {
      max-width: 800px;
      margin: 0 auto;
      text-align: center;
      position: relative;
      z-index: 1;

      .cta-title {
        font-size: $custom-font-4xl;
        font-weight: $custom-font-bold;
        color: $custom-white;
        margin-bottom: 20px;
        line-height: $custom-line-tight;

        @media (max-width: $custom-breakpoint-lg) {
          font-size: $custom-font-3xl;
        }

        @media (max-width: $custom-breakpoint-md) {
          font-size: $custom-font-2xl;
          margin-bottom: 16px;
        }
      }

      .cta-description {
        font-size: $custom-font-xl;
        color: rgba(255, 255, 255, 0.9);
        margin-bottom: 40px;
        line-height: $custom-line-relaxed;

        @media (max-width: $custom-breakpoint-lg) {
          font-size: $custom-font-lg;
        }

        @media (max-width: $custom-breakpoint-md) {
          font-size: $custom-font-base;
          margin-bottom: 32px;
        }
      }

      .cta-buttons {
        display: flex;
        gap: 20px;
        justify-content: center;
        flex-wrap: wrap;

        @media (max-width: $custom-breakpoint-sm) {
          flex-direction: column;
          align-items: center;
          gap: 16px;
        }

        .cta-btn {
          padding: 16px 32px;
          border-radius: $custom-radius-xl;
          font-size: $custom-font-lg;
          font-weight: $custom-font-semibold;
          border: none;
          cursor: pointer;
          transition: all $custom-transition-normal;
          min-width: 160px;

          @media (max-width: $custom-breakpoint-md) {
            padding: 14px 28px;
            font-size: $custom-font-base;
            min-width: 140px;
          }

          &.primary-btn {
            background: $custom-primary;
            color: $custom-white;

            &:hover {
              background: darken($custom-primary, 8%);
              transform: translateY(-2px);
              box-shadow: 0 8px 25px rgba($custom-primary, 0.4);
            }

            &:active {
              transform: translateY(0);
            }
          }

          &.secondary-btn {
            background: transparent;
            color: $custom-white;
            border: 2px solid $custom-white;

            &:hover {
              background: $custom-white;
              color: $custom-secondary;
              transform: translateY(-2px);
              box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
            }

            &:active {
              transform: translateY(0);
            }
          }
        }
      }
    }
  }
}

/* ===== 资讯列表模块样式 ===== */
.news-content-wrapper {
  width: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
      radial-gradient(circle at 20% 20%, rgba(var(--custom-primary-rgb), 0.03) 0%, transparent 50%),
      radial-gradient(circle at 80% 80%, rgba(var(--custom-secondary-rgb), 0.03) 0%, transparent 50%);
    pointer-events: none;
  }
}

/* 资讯英雄区域 */
.news-hero-section {
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg, 
    rgba(var(--custom-primary-rgb), 0.08) 0%, 
    rgba(var(--custom-secondary-rgb), 0.05) 100%);
  position: relative;
  
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      radial-gradient(circle at 1px 1px, rgba(var(--custom-primary-rgb), 0.15) 1px, transparent 0);
    background-size: 20px 20px;
    opacity: 0.3;
  }
}

.news-hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.news-hero-text {
  .news-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: $custom-text-primary;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, $custom-primary, $custom-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
  }
  
  .news-hero-description {
    font-size: 1.125rem;
    color: $custom-text-secondary;
    line-height: 1.6;
    max-width: 600px;
  }
}

.news-stats {
  display: flex;
  gap: 2rem;
  
  .stat-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: $custom-radius-lg;
    box-shadow: $custom-shadow-sm;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
    
    .stat-number {
      font-size: 2rem;
      font-weight: 700;
      color: $custom-primary;
      margin-bottom: 0.5rem;
    }
    
    .stat-label {
      font-size: 0.875rem;
      color: $custom-text-secondary;
      font-weight: 500;
    }
  }
}

/* 资讯列表区域 */
.news-list-section {
  padding: 4rem 0;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.news-list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.news-item-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: $custom-radius-xl;
  overflow: hidden;
  box-shadow: $custom-shadow-md;
  transition: all $custom-transition-normal ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  position: relative;
  
  &:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    
    .news-image {
      transform: scale(1.05);
    }
    
    .news-overlay {
      opacity: 1;
    }
  }
  
  &:nth-child(3n+1) {
    .news-card-title {
      color: $custom-primary;
    }
  }
  
  &:nth-child(3n+2) {
    .news-card-title {
      color: $custom-secondary;
    }
  }
  
  &:nth-child(3n+3) {
    .news-card-title {
      color: $custom-link;
    }
  }
}

.news-card-image {
  position: relative;
  height: 220px;
  overflow: hidden;
  
  .news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform $custom-transition-normal ease;
  }
  
  .news-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.1) 0%,
      rgba(0, 0, 0, 0.3) 50%,
      rgba(0, 0, 0, 0.7) 100%
    );
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity $custom-transition-normal ease;
    
    .news-category {
      background: $custom-primary;
      color: white;
      padding: 0.25rem 0.75rem;
      border-radius: $custom-radius-full;
      font-size: 0.75rem;
      font-weight: 600;
    }
    
    .news-date {
      color: white;
      font-size: 0.875rem;
      font-weight: 500;
    }
  }
}

.news-card-content {
  padding: 1.5rem;
}

.news-card-header {
  margin-bottom: 1rem;
  
  .news-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color $custom-transition-normal ease;
  }
  
  .news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: $custom-text-secondary;
    
    .news-author {
      font-weight: 500;
    }
    
    .news-views {
      display: flex;
      align-items: center;
      gap: 0.25rem;
      
      .view-icon {
        width: 1rem;
        height: 1rem;
      }
    }
  }
}

.news-card-body {
  margin-bottom: 1.5rem;
  
  .news-content-preview {
      color: $custom-text-secondary;
      line-height: 1.6;
      margin-bottom: 1rem;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
      
      /* 富文本内容样式重置 */
      :deep(p) {
        margin: 0 0 0.5rem 0;
        line-height: inherit;
      }
      
      :deep(h1), :deep(h2), :deep(h3), :deep(h4), :deep(h5), :deep(h6) {
        margin: 0 0 0.5rem 0;
        font-size: inherit;
        font-weight: 600;
        color: inherit;
      }
      
      :deep(strong), :deep(b) {
        font-weight: 600;
        color: $custom-text-primary;
      }
     
     :deep(em), :deep(i) {
       font-style: italic;
     }
     
     :deep(a) {
       color: $custom-primary;
       text-decoration: none;
       
       &:hover {
         text-decoration: underline;
       }
     }
     
     :deep(ul), :deep(ol) {
       margin: 0;
       padding-left: 1rem;
       
       li {
         margin-bottom: 0.25rem;
       }
     }
     
     :deep(blockquote) {
        margin: 0;
        padding-left: 1rem;
        border-left: 3px solid $custom-primary;
        font-style: italic;
        color: $custom-text-secondary;
      }
     
     :deep(code) {
       background: rgba(var(--custom-primary-rgb), 0.1);
      color: $custom-primary;
      padding: 0.125rem 0.25rem;
      border-radius: $custom-radius-sm;
      font-size: 0.875em;
      font-family: 'Courier New', monospace;
    }
     
     :deep(img) {
       display: none; // 在预览中隐藏图片
     }
     
     :deep(br) {
       line-height: 0;
     }
     
     // 移除多余的空白和换行
     :deep(*) {
       max-width: 100%;
     }
   }
  
  .news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    
    .news-tag {
      background: rgba(var(--custom-primary-rgb), 0.1);
      color: $custom-primary;
      padding: 0.25rem 0.75rem;
      border-radius: $custom-radius-full;
      font-size: 0.75rem;
      font-weight: 500;
      border: 1px solid rgba(var(--custom-primary-rgb), 0.2);
    }
  }
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  .news-read-more {
    background: linear-gradient(135deg, $custom-primary, $custom-secondary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: $custom-radius-lg;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all $custom-transition-normal ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(var(--custom-primary-rgb), 0.3);
    }
    
    .arrow-icon {
      width: 1rem;
      height: 1rem;
      transition: transform $custom-transition-normal ease;
    }
    
    &:hover .arrow-icon {
      transform: translateX(4px);
    }
  }
  
  .news-actions {
    display: flex;
    gap: 0.5rem;
    
    .action-btn {
      width: 2.5rem;
      height: 2.5rem;
      border: 1px solid rgba(var(--custom-primary-rgb), 0.2);
      background: rgba(255, 255, 255, 0.8);
      border-radius: $custom-radius-lg;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all $custom-transition-normal ease;
      
      .action-icon {
        width: 1.125rem;
        height: 1.125rem;
        color: $custom-text-secondary;
        transition: color $custom-transition-normal ease;
      }
      
      &:hover {
        background: $custom-primary;
        border-color: $custom-primary;
        
        .action-icon {
          color: white;
        }
      }
      
      &.like-btn:hover {
        background: $custom-danger;
        border-color: $custom-danger;
      }
    }
  }
}

/* 加载更多按钮 */
.news-load-more {
  text-align: center;
  
  .load-more-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid $custom-primary;
    color: $custom-primary;
    padding: 1rem 2rem;
    border-radius: $custom-radius-xl;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all $custom-transition-normal ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
    
    .plus-icon {
      width: 1.25rem;
      height: 1.25rem;
      transition: transform $custom-transition-normal ease;
    }
    
    &:hover {
      background: $custom-primary;
      color: white;
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(var(--custom-primary-rgb), 0.3);
      
      .plus-icon {
        transform: rotate(90deg);
      }
    }
  }
}

/* 空状态 */
.news-empty-state {
  padding: 4rem 0;
  text-align: center;
  
  .empty-content {
    max-width: 400px;
    margin: 0 auto;
    
    .empty-icon {
      width: 4rem;
      height: 4rem;
      color: $custom-text-muted;
      margin-bottom: 1.5rem;
    }
    
    .empty-title {
      font-size: 1.5rem;
      font-weight: 600;
      color: $custom-text-secondary;
      margin-bottom: 0.75rem;
    }
    
    .empty-description {
      color: $custom-text-muted;
      line-height: 1.6;
    }
  }
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .news-hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .news-stats {
    justify-content: center;
  }
  
  .news-list-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .news-hero-section {
    padding: 3rem 0 2rem;
  }
  
  .news-hero-content {
    padding: 0 1rem;
  }
  
  .news-hero-text {
    .news-hero-title {
      font-size: 2rem;
    }
    
    .news-hero-description {
      font-size: 1rem;
    }
  }
  
  .news-stats {
    flex-direction: column;
    gap: 1rem;
    
    .stat-item {
      padding: 1rem;
      min-width: auto;
      
      .stat-number {
        font-size: 1.5rem;
      }
    }
  }
  
  .news-list-section {
    padding: 3rem 1rem;
  }
  
  .news-list-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .news-card-content {
    padding: 1.25rem;
  }
  
  .news-card-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    
    .news-actions {
      justify-content: center;
    }
  }
}

@media (max-width: 640px) {
  .news-hero-text {
    .news-hero-title {
      font-size: 1.75rem;
    }
  }
  
  .news-card-image {
    height: 180px;
  }
  
  .news-card-content {
    padding: 1rem;
  }
  
  .news-card-header {
    .news-card-title {
      font-size: 1.125rem;
    }
  }
}
</style>
